import {JWTPayloadSpec} from '@elysiajs/jwt'

export type Jwt = {
  readonly sign: (morePayload: TokenInfo & JWTPayloadSpec) => Promise<string>
  readonly verify: (jwt?: string) => Promise<false | (TokenInfo & JWTPayloadSpec)>
}

export type TokenInfo = {
  isRefresh: boolean
  roleIds: Array<number>
  userId: number
  username: string
  sign: string
  timestamp: number
}
